#include"position_pid_ctr.h"
void positionPid::parameterReconfigCB(pure_pursuit_pkg::positionPidConfig &config)//pid 参数配置回调函数
{
    Kp=config.positionKp;
    Ki=config.positionKi;
    Kd=config.positionKd;
    IntergrationDownLimit=config.positionIntergrationDownLimit;
    IntergrationUplimit=config.positionIntergrationUplimit;
    downLimit=config.positionDownLimit;
    upLimit=config.positionUpLimit;
    ROS_INFO("position pid parameter is reconfigured: %f %f %f", 
        Kp,Ki,Kd);
    ROS_INFO("%f %f %f %f", 
        IntergrationDownLimit,IntergrationUplimit,\
        downLimit,upLimit);
}

positionPid::positionPid(double Kp_local,double Ki_local,double Kd_local,double deltaTime_local):\
    clampPid(Kp_local,Ki_local,Kd_local,deltaTime_local)
{
    server.setCallback(boost::bind(&positionPid::parameterReconfigCB, this, _1));
}
positionPid::positionPid( double Kp_local,double Ki_local,double Kd_local,\
              double deltaTime_local,\
              double downLimit_local,\
              double upLimit_local,\
              double IntergrationDownLimit_local,\
              double  IntergrationUplimit_local ):\
            clampPid( Kp_local,Ki_local, Kd_local,\
                deltaTime_local,\
                downLimit_local,\
                upLimit_local,\
                IntergrationDownLimit_local,\
                IntergrationUplimit_local )
{    
        server.setCallback(boost::bind(&positionPid::parameterReconfigCB, this, _1));
}


